﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Exam.aspx.cs" Inherits="ProjectSem40701.Admin.Exam" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Kỳ thi</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    
    <li><a href="ExamAdd.aspx" class="report">Thêm kỳ thi mới</a></li>
    <li><a href="UserRound.aspx">Chọn thí sinh vào vòng sau</a></li>
    <li><a href="RoundAdd.aspx">Thêm vòng thi mới</a></li>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("7"));
    </script>
    <!--
        end set tab active
     -->
     <div id="box">
        <telerik:radscriptmanager ID="RadScriptManager1" runat="server">
        </telerik:radscriptmanager>      
        <h3>Quản lý kỳ thi</h3>
        <telerik:RadGrid ID="rgrExam" runat="server" AllowFilteringByColumn="True" 
             AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                 DataSourceID="ObjectDataSource1" Skin="Default">
            <MasterTableView CellSpacing="-1" DataKeyNames="ExamID" DataSourceID="ObjectDataSource1">
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>

            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="ExamName" HeaderText="Tên kỳ thi" 
                        SortExpression="ExamName" UniqueName="ExamName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ExamStartTime" DataType="System.DateTime" 
                        HeaderText="Thời điểm bắt đầu" SortExpression="ExamStartTime" 
                        UniqueName="ExamStartTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ExamEndTime" DataType="System.DateTime" 
                        HeaderText="Thời điểm kết thúc" SortExpression="ExamEndTime" 
                        UniqueName="ExamEndTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="ExamStatus" DataType="System.Int32" 
                        HeaderText="Trạng thái" SortExpression="ExamStatus" UniqueName="ExamStatus">
                        <ItemTemplate>
                            <asp:Label ID="ExamStatusLabel" runat="server" Text='<%# Eval("ExamStatus") %>' 
                                ondatabinding="ExamStatusLabel_DataBinding"></asp:Label>
                        </ItemTemplate>
                        <FilterTemplate>
                             <asp:DropDownList ID="cbbStatus" runat="server" 
                                    AutoPostBack="true" OnPreRender="cbbStatus_PreRender"
                                    OnSelectedIndexChanged="cbbStatus_SelectedIndexChanged" >
                                    <asp:ListItem Text="Tất cả" Value="-1"></asp:ListItem>
                                    <asp:ListItem Text="Hoạt động" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Khóa" Value="0"></asp:ListItem>
                             </asp:DropDownList>
                        </FilterTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridCheckBoxColumn DataField="ExamIsCurrent" DataType="System.Boolean" 
                        HeaderText="Kỳ hiện tại" SortExpression="ExamIsCurrent" 
                        UniqueName="ExamIsCurrent">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn">
                        <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" 
                                NavigateUrl='<%# Eval("ExamID", "ExamEdit.aspx?exid={0}") %>'>Xem</asp:HyperLink>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
    </telerik:RadGrid>
    <asp:Label ID="lblSelectedIndex" runat="server" Text="-1" Visible="False"></asp:Label>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
             OldValuesParameterFormatString="original_{0}" 
             SelectMethod="Get_tbl_Exam_Select_All" 
             TypeName="ProjectSem40701.Admin.AdminXSD.ExamTableAdapters.tbl_ExamTableAdapter">
    </asp:ObjectDataSource>
    </div>
</asp:Content>
